<template>
  <a class="toNews" target="_blank" :href="detail.url" v-if="detail?.url"
    ><slot></slot
  ></a>
  <a
    class="toNews"
    target="_blank"
    v-else-if="detail?.videofile && detail?.filetype == 2"
    :href="detail.videofile"
    ><slot></slot
  ></a>
  <router-link
    class="toNews"
    :to="{
      path: 'innovationDetail',
      query: {
        id: detail.id,
      },
    }"
    v-else-if="detail?.category_id == 3 || detail?.category_id == 4"
  >
    <slot></slot>
  </router-link>
  <router-link
    class="toNews"
    :to="{
      path: 'newsDetail',
      query: {
        id: detail.id,
      },
    }"
    v-else-if="detail?.category_id == 58 || detail?.category_id == 59"
  >
    <slot></slot>
  </router-link>
  <router-link
    class="toNews"
    :to="{
      path: 'socialResponsibilityDetail',
      query: {
        id: detail.id,
      },
    }"
    v-else-if="detail?.category_id == 106 || detail?.category_id == 107"
  >
    <slot></slot>
  </router-link>
  <router-link
    class="toNews"
    :to="{
      path: 'humanResourcesNewsDetail',
      query: {
        id: detail.id,
      },
    }"
    v-else-if="detail?.category_id == 76"
  >
    <slot></slot>
  </router-link>
  <router-link
    class="toNews"
    :to="{
      path: 'detail',
      query: {
        id: detail?.id,
      },
    }"
    v-else
  >
    <slot></slot>
  </router-link>
</template>

<script>
export default {
  components: {},
  props: {
    detail: Object,
  },
  methods: {},
};
</script>
<style lang="scss" scoped>
.toNews {
  display: block;
}
</style>